Skip to content

refactor: use native Node glob APIs#1234

Draft
314systems wants to merge 4 commits intoopennextjs:mainfrom
314systems:glob
Draft

refactor: use native Node glob APIs#1234
314systems wants to merge 4 commits intoopennextjs:mainfrom
314systems:glob

Conversation

@314systems
Copy link
Copy Markdown
Contributor

Use Node.js native glob APIs for cache population and build-time patch discovery instead of the glob package. This keeps path handling based on explicit working directories and removes the direct glob dependency.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: 56fd68a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@1234

commit: 56fd68a

Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

What is the minimal version of Node required?
Please answer the question in the PR description and by adding an engines entry in package.json

Also please do not change async <> sync if there is no good reason to do so - if there are please do that in a follow up PR explaining the rationale in the description

Comment thread .changeset/glob.md
@@ -0,0 +1,7 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not really need a changeset for that if there are no user facing change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are no changes facing users directly.

However, since this PR defines engines, I thought it should be submitted as a patch.

@314systems
Copy link
Copy Markdown
Contributor Author

314systems commented Apr 27, 2026

What is the minimal version of Node required?

https://nodejs.org/api/fs.html#fspromisesglobpattern-options

Added in: v22.0.0

Version Changes
v24.1.0, v22.17.0 Add support for URL instances for cwd option.
v24.0.0, v22.17.0 Marking the API stable.
v23.7.0, v22.14.0 Add support for exclude option to accept glob patterns.
v22.2.0 Add support for withFileTypes as an option.

v22.17.0 (or v24.1.0) is.

Node v20 is reaching EOL soon (April 2026), so I think we can safely drop support for it.

@james-elicx
Copy link
Copy Markdown
Collaborator

Node v20 is reaching EOL soon, so I think we can safely drop support for it.

If I recall correctly, I believe the plan was for the minimum Node version to be bumped as part of the next major. The AWS adapter still supports Node.js v20 as well.

For what it's worth, many companies will use a Node.js version right up until it EOLs, and continue using it beyond that.

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Apr 28, 2026

Node v20 is reaching EOL soon, so I think we can safely drop support for it.

If I recall correctly, I believe the plan was for the minimum Node version to be bumped as part of the next major. The AWS adapter still supports Node.js v20 as well.

For what it's worth, many companies will use a Node.js version right up until it EOLs, and continue using it beyond that.

Good point @james-elicx.

I'll move this PR to draft for now.
I don't think we need to rush this change before the next major as it might break users.

@vicb vicb marked this pull request as draft April 28, 2026 05:25
@314systems
Copy link
Copy Markdown
Contributor Author

(Note: Node 20 is now EOL)

@sommeeeer
Copy link
Copy Markdown
Collaborator

I can confirm what @james-elicx is saying. One of the companies I work for are still using Node v20 in AWS Lambdas even though it has reached end of support recently. Looking in AWS docs I see that we should probably update soon.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants